package com.bwie.auth.controller;

import com.bwie.auth.service.AuthService;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author：杨鹏
 * @Package：com.bwie.auth.controller
 * @Project：yp_zhoukao723
 * @name：AuthController
 * @Date：2024/7/23 9:26
 */
@RestController
@RequestMapping("auth")
public class AuthController {

    @Autowired
    private AuthService authService;

    @PostMapping("login")
    public Result<User> login(@RequestBody User user){
        return authService.login(user);
    }

    @GetMapping("info")
    public Result<User> info(){
        return authService.info();
    }

    @PostMapping("logout")
    public void logout(){
       authService.logout();
    }

}
